#include "addpeopleitem.h"
#include "ui_addpeopleitem.h"

addpeopleitem::addpeopleitem(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::addpeopleitem)
{
    ui->setupUi(this);
    applyadd->setGeometry(200,130,500,500);
    applyadd->hide();
    connect(applyadd,&applyaddpeople::sendextrames,[=](QString mes){
        extrames=mes;
        emit addpeopleitemsignals(account,extrames);
    });
}
void addpeopleitem::init(QString n, QString im, QString accoun)
{
    name=n;
    image=im;
    account=accoun;
    ui->image->setPixmap(QPixmap(image));
    ui->name->setText(name);
    ui->account->setText(account);
    if(name=="")
        ui->addpeobtn->hide();
    else
        ui->addpeobtn->show();

}

addpeopleitem::~addpeopleitem()
{
    delete ui;
}


void addpeopleitem::on_addpeobtn_clicked()
{
    applyadd->init(image,account,name);
    applyadd->show();

}

